package gat.common.enums;

import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonProperty;

import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.NoArgsConstructor;

/**
 * 合作信息权益类型枚举
 * @Author sxq
 * @Date 2022/5/10
 * @Version 1.0
 */
@NoArgsConstructor
@AllArgsConstructor
@Getter
public enum CooperationInfoPrivilegeTypeEnums {


    SUPER_TOP(1, "超级置顶"),
    RECOMMEND_TOP(2, "推荐置顶"),
    TYPE_TOP(3, "分类置顶"),
    NORMAL(5, "其他"),

    ;
    private Integer code;

    private String value;

    @JsonCreator(mode = JsonCreator.Mode.PROPERTIES)
    public static CooperationInfoPrivilegeTypeEnums getByCode(@JsonProperty("code") String code) {
        for (CooperationInfoPrivilegeTypeEnums value : values()) {
            if (value.getCode().equals(code)) {
                return value;
            }
        }
        return null;
    }

}
